-
Notifications
You must be signed in to change notification settings - Fork 120
Update commit_hash field to GetInfo response #946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update commit_hash field to GetInfo response #946
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one comment!
Makefile
Outdated
LDFLAGS := -ldflags "-X $(PKG).Commit=$(COMMIT)" | ||
COMMIT := $(shell git describe --abbrev=40 --dirty --tags) | ||
COMMIT_HASH := $(shell git rev-parse HEAD) | ||
DIRTY := $(shell git diff-index --quiet HEAD -- || echo -dirty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of -dirty
we should store it as dirty
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good idea! Addressed with the latest push :).
Update the output of the `commit_hash` field in the GetInfoResponse. The `commit_hash` field will contain the most recent commit_hash that the build was based on. If the build had uncommitted changes, this field will contain the most recent commit hash, suffixed by "-dirty". Note that this change also changes the output of `commit` field in the `--version` command. The `Commit` field will now contain most recent git commit tag.
The `commit_hash` field will contain the full commit hash of the commit that build was based on.
0198172
to
3aaef99
Compare
Thanks for the swift review @bhandras 🙏! Addressed your feedback with the latest push. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK, thanks @ViktorTigerstrom!
This PR updates the
GetInfo
response to adhere to lightninglabs/lightning-terminal#1034.In general it updates the output of the
commit_hash
field in the GetInfoResponse.The
commit_hash
field will now contain the most recent commit_hash that the build was based on. If the build had uncommitted changes, this field will contain the most recent commit hash, suffixed by "-dirty".We also change the output of
commit
field in the--version
command. TheCommit
field will now contain most recent git commit tag.Note that both of these changes are breaking changes!
Additionally we also add a
commit_hash
part of the output of the--version
output.